Two-way nondeterministic finite automaton